﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;

using System.Text;
using System.Threading.Tasks;
using Sharp.DataTransferObject;
using Sharp.Infrastructure;
using Sharp.Infrastructure.Interfaces;
using Sharp.Infrastructure.Search;

namespace Sharp.ServiceContracts
{
    /// <summary>
    /// 企业服务
    /// </summary>
    [ContractTag(Tag = ContractTagEnum.Authorize)]
    public interface IEnterpriseService : IApplicationServiceContract
    {
        #region 人员模块
        /// <summary>
        /// 保存员工
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>

        Result SaveEmployee(EmployeeDTO model);

        /// <summary>
        /// 删除员工
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>

        Result DeleteEmployee(int[] ids);

        /// <summary>
        /// 获取员工
        /// </summary>
        /// <returns></returns>

        EmployeeDTO GetEmployeeInfo(int id);

        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <param name="pf"></param>
        /// <returns></returns>

        PagedResult<EmployeeDTO> GetEmployeePaged(PagingFeature pf);


        /// <summary>
        /// 组织里面的员工
        /// </summary>
        /// <param name="orgIds"></param>
        /// <returns></returns>

        IEnumerable<EmployeeDTO> GetEmployeesInOrg(Guid[] orgIds);

        /// <summary>
        /// 保存工作岗位
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>

        Result SaveJob(JobDTO model);

        /// <summary>
        /// 删除工作岗位
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>

        Result DeleteJob(int[] ids);

        /// <summary>
        /// 获取员工
        /// </summary>
        /// <returns></returns>

        JobDTO GetJobInfo(int id);

        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <param name="pf"></param>
        /// <returns></returns>

        PagedResult<JobDTO> GetJobPaged(PagingFeature pf);
        #endregion

        #region 组织结构模块
        /// <summary>
        /// 保存组织结构
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>

        Result SaveOrg(OrgDTO model);
        /// <summary>
        /// 删除组织结构
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>

        Result DeleteOrgs(Guid[] ids);
        /// <summary>
        /// 获取组织结构
        /// </summary>
        /// <returns></returns>

        OrgDTO GetOrgInfo(Guid id);
        /// <summary>
        /// 获取所有组织结构
        /// </summary>
        /// <returns></returns>

        Task<IEnumerable<OrgDTO>> GetOrgs();

        /// <summary>
        /// 获取所有组织结构带编制统计
        /// </summary>
        /// <returns></returns>

        Task<IEnumerable<OrgDTO>> GetOrgsWithCount();
        /// <summary>
        /// 组织结构排序
        /// </summary>
        /// <param name="parentId"></param>
        /// <param name="ids"></param>
        /// <returns></returns>

        Result OrgMoveOrSort([ToUri]Guid? parentId, Guid[] ids);

        /// <summary>
        /// 保存组
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>

        Result SaveGroup(GroupDTO model);

        /// <summary>
        /// 设置为用户
        /// </summary>
        /// <param name="userDTO"></param>
        /// <param name="employeeId"></param>
        /// <returns></returns>

        Result EmployeeAsUser([ToBody]UserDTO userDTO, [ToUri]int employeeId);

        /// <summary>
        /// 删除组
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>

        Result DeleteGroups(int[] ids);
        /// <summary>
        /// 获取组
        /// </summary>
        /// <returns></returns>
        GroupDTO GetGroupInfo(int id);
        /// <summary>
        /// 获取组分页数据
        /// </summary>
        /// <param name="pf"></param>
        /// <returns></returns>

        PagedResult<GroupDTO> GetGroupPaged(PagingFeature pf);

        #endregion

        #region 组织层级

        /// <summary>
        /// 保存组织层级
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>

        Result SaveOrgLevel(OrgLevelDTO model);

        /// <summary>
        /// 删除岗位
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>

        Result DeleteOrgLevel(Guid[] ids);

        /// <summary>
        /// 获取一条主数据
        /// </summary>
        /// <returns></returns>

        OrgLevelDTO GetOrgLevelInfo(Guid id);

        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <param name="pf"></param>
        /// <returns></returns>

        PagedResult<OrgLevelDTO> GetOrgLevelPaged(PagingFeature pf);

        /// <summary>
        /// 获取组织层级
        /// </summary>
        /// <returns></returns>

        Task<IEnumerable<OrgLevelDTO>> GetOrgLevelList();


        #endregion  
    }
}
